/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.stuffrepos.bricknetcenter.util;

/**
 *
 * @author Eduardo H. Bogoni <eduardobogoni@gmail.com>
 */
public abstract class LoopingThread extends Thread {

    private boolean runLooping;

    @Override
    public final void run() {
        super.run();

        runLooping = true;
        while (runLooping) {
            loopingRun();
        }
    }

    public abstract void loopingRun();

    public final void stopLooping() {
        this.runLooping = false;
    }
}
